package com.subaiwang.service.video;

import com.subaiwang.dao.video.VideoMapper;
import com.subaiwang.pojo.Pages;
import com.subaiwang.pojo.Video;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("videoService")
public class VideoServiceImpl implements VideoService{
    @Resource
    private VideoMapper videoMapper;
    @Override
    public void getVideo(String classify, String idValue, Pages pages) {
      List<Video> list=videoMapper.getVideo(classify,idValue,((pages.getPageNo()-1)*pages.getPageSize()),pages.getPageSize());
      pages.setVideoList(list);
    }

    @Override
    public int VideoCount(String classify, String idValue) {
        return videoMapper.VideoCount(classify,idValue);
    }
}
